package com.muyu.danmo.service.impl;


import com.muyu.common.core.utils.DateUtils;
import com.muyu.danmo.domain.DanmoGalleryGuarantees;
import com.muyu.danmo.mapper.DanmoGalleryGuaranteesMapper;
import com.muyu.danmo.service.IDanmoGalleryGuaranteesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 保证金Service业务层处理
 *
 * @author yangle
 * @date 2024-10-23
 */
@Service
public class DanmoGalleryGuaranteesServiceImpl implements IDanmoGalleryGuaranteesService
{
    @Autowired
    private DanmoGalleryGuaranteesMapper danmoGalleryGuaranteesMapper;

    /**
     * 查询保证金
     *
     * @param id 保证金主键
     * @return 保证金
     */
    @Override
    public DanmoGalleryGuarantees selectDanmoGalleryGuaranteesById(Long id)
    {
        return danmoGalleryGuaranteesMapper.selectDanmoGalleryGuaranteesById(id);
    }

    /**
     * 查询保证金列表
     *
     * @param danmoGalleryGuarantees 保证金
     * @return 保证金
     */
    @Override
    public List<DanmoGalleryGuarantees> selectDanmoGalleryGuaranteesList(DanmoGalleryGuarantees danmoGalleryGuarantees)
    {
        return danmoGalleryGuaranteesMapper.selectDanmoGalleryGuaranteesList(danmoGalleryGuarantees);
    }

    /**
     * 新增保证金
     *
     * @param danmoGalleryGuarantees 保证金
     * @return 结果
     */
    @Override
    public int insertDanmoGalleryGuarantees(DanmoGalleryGuarantees danmoGalleryGuarantees)
    {
        danmoGalleryGuarantees.setCreateTime(DateUtils.getNowDate());
        return danmoGalleryGuaranteesMapper.insertDanmoGalleryGuarantees(danmoGalleryGuarantees);
    }

    /**
     * 修改保证金
     *
     * @param danmoGalleryGuarantees 保证金
     * @return 结果
     */
    @Override
    public int updateDanmoGalleryGuarantees(DanmoGalleryGuarantees danmoGalleryGuarantees)
    {
        danmoGalleryGuarantees.setUpdateTime(DateUtils.getNowDate());
        return danmoGalleryGuaranteesMapper.updateDanmoGalleryGuarantees(danmoGalleryGuarantees);
    }

    /**
     * 批量删除保证金
     *
     * @param ids 需要删除的保证金主键
     * @return 结果
     */
    @Override
    public int deleteDanmoGalleryGuaranteesByIds(Long[] ids)
    {
        return danmoGalleryGuaranteesMapper.deleteDanmoGalleryGuaranteesByIds(ids);
    }

    /**
     * 删除保证金信息
     *
     * @param id 保证金主键
     * @return 结果
     */
    @Override
    public int deleteDanmoGalleryGuaranteesById(Long id)
    {
        return danmoGalleryGuaranteesMapper.deleteDanmoGalleryGuaranteesById(id);
    }
}
